package com.sc.design.mediator;

public class Stock extends AbstractColleague {
    public Stock(AbstractMediator _mediator) {
        super(_mediator);
    }

    private static int COMPUTER_STOCK = 100;
    public void increase(int num){
        COMPUTER_STOCK = COMPUTER_STOCK+num;
        System.out.println("库存为"+COMPUTER_STOCK);
    }
    public void decreate(int count){
        COMPUTER_STOCK = COMPUTER_STOCK-count;
        System.out.println("库存为"+COMPUTER_STOCK);
    }

    public int getStock(){
        return COMPUTER_STOCK;
    }

    public void clearStock(){
        System.out.println("清理库存"+COMPUTER_STOCK);
        super.mediator.execute("stock.clear");
    }
}
